<extend name="./main"/>
<block name="title">
    <title>qzone后台----相册管理</title>
</block>
<block name="main">
<script src="__PUBLIC__/js/jquery.min.js"></script>
<div class="col-md-12">
    <section class="panel">
        <div class="panel-body">
            <center><h2>相册管理</h2></center>
            <ul class="nav nav-tabs">
                <li class="active">
                    <a href="{:U('index')}">审核图片</a>
                </li>
                <li class="">
                    <a href="{:U('delete')}">被删除的图片</a>
                </li>
            </ul>
            
            <!-- <table class="table  table-hover general-table mt30" id="loglist">
                <thead>
                <tr>
                    <th>用户ID</th>
                    <th class="hidden-phone">日志标题</th>
                    <th>发表时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <volist name="logList" id="vo">
                <tr class="logitem">
                    <td><a href="#">{$vo.uid}</a></td>
                    <td><a href="{:U('detail',array('id'=>$vo['id']))}">{$vo.title}</a></td>
                    <td>{$vo.ctime|date="Y-m-d H:i:s",###} </td>
                    <td><button class="label label-warning label-mini act-del" dataid="{$vo.id}">删除</button></td>
                </tr>
                </volist>
                </tbody>
            </table> -->
        </div>
        <div class="panel-body" style="display: block;">

            <div id="gallery" class="media-gal isotope" style="position: relative; overflow: hidden; height: 749.390625px;">
                <volist name="Album_photoList" id="vo">
                    <div class="images item  isotope-item" >
                        <a href="#myModal{$vo.id}" data-toggle="modal">
                            <img src="__PUBLIC__{$vo.path}" alt="">
                        </a>
                        <p>{$vo.path|substr=18}</p>
                    </div>

                    <!-- Modal -->
                    <div class="modal fade photo_item" id="myModal{$vo.id}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                    <h4 class="modal-title">图片详情</h4>
                                </div>
                    
                                <div class="modal-body row">
                    
                                    <div class="col-md-5 img-modal">
                                        <img src="__PUBLIC__{$vo.path}" alt="">
                                        <p class="mtop10"><strong>图片名称:</strong> {$vo.path|substr=18}</p>
                                        <p><strong>上传者:</strong> <a href="#">{$vo.uid}</a></p>
                                    </div>
                                    <div class="col-md-7">
                                        <div class="form-group">
                                            <label>  标题</label>
                                            <input id="title" value="{$vo.photo_name}" class="form-control">
                                        </div>
                                        <div class="form-group">
                                            <label> 描述</label>
                                            <textarea rows="5" class="form-control">{$vo.photo_describe}</textarea>
                                        </div>
                                        <div class="pull-right">
                                            <button class="btn btn-danger btn-sm act-del" dataid="{$vo.id}" type="button">删除</button>
                                            <button class="btn btn-success btn-sm" type="button" data-dismiss="modal">返回</button>
                                        </div>
                                    </div>
                    
                                </div>
                    
                            </div>
                        </div>
                    </div>
                    <!-- modal -->
                </volist>
            </div>

            <div class="col-md-12 text-center clearfix">
                <ul class="pagination">
                    <!-- <li><a href="#">«</a></li>
                    <li><a href="#">1</a></li>
                    <li><a href="#">2</a></li>
                    <li><a href="#">3</a></li>
                    <li><a href="#">4</a></li>
                    <li><a href="#">5</a></li>
                    <li><a href="#">»</a></li> -->
                    {$page}
                </ul>
                
            </div>

            

        </div>
    </section>
</div>
<script>
    $('#gallery').on('click','.act-del',function(){
        // debugger;
        var self = $(this);
        var id = self.attr('dataid');
        $.ajax({
            type:'POST',
            url:'{:U("del")}',
            data:{'id':id},
            datatype:'json',
            success:function(rs){
                if(rs.status == 'success'){
                    self.parents('div.photo_item').prev().remove();
                    self.next().click();
                }else{
                    alert(rs.msg);
                }
            }
        });
    });
</script>
</block>